package gamefw.tests;

import gamefw.framework.Coordinate;
import junit.framework.TestCase;

public class TestCoordinate extends TestCase {

	/*
	 * CO01
	 * Test to check if a coordinate is created correctly
	 */
	public void testCoordinate () {
		Coordinate c1 = new Coordinate(0,0);
		assertTrue(c1.getX() == 0);
		assertTrue(c1.getY() == 0);
	}

	/*
	 * CO02
	 * Test to check if a coordinate is created correctly when another coordinate
	 * is used as source.
	 */
	public void testCopyCoordinate() {
		Coordinate c1 = new Coordinate(0,0);
		Coordinate c2 = new Coordinate(c1);
		assertTrue(c2.getX() == 0);
		assertTrue(c2.getY() == 0);
	}

	/**
	 * CO03
	 * Test to check if coordinate setters work accordingly
	 */
	public void testSetters () {
		Coordinate c1 = new Coordinate(0,0);
		c1.setX(1);
		c1.setY(1);
		assertTrue(c1.getX() == 1);
		assertTrue(c1.getY() == 1);		
	}
}
